<template>
  <view>
    
    <van-nav-bar
    title="申请" 
    right-text="申请记录"
    left-arrow
    @click-left="onClickLeft"
    @click-right="onClickRight"
  /> 
    <van-tabs :active="active" @change='changeTab'>
      <van-tab :title="'请假申请'">
        <Vacation></Vacation>
      </van-tab>
      <van-tab :title="'加班申请'">
        <WarkOvertime></WarkOvertime>
      </van-tab>
    </van-tabs>
  </view>
</template>
<script setup>
import Vacation from "./vacation.vue";
import WarkOvertime from "./warkOvertime.vue";
import { onLoad } from "@dcloudio/uni-app";
const active = ref(0);
onLoad((options) => {
  // active.value = options.type;
});
onShow(() => {});
const onClickLeft=()=>{
   uni.navigateBack({
    delta:1
   })
}
const changeTab=(e)=>{ 
	  active.value = e
}
const onClickRight=()=>{
	console.log(active.value)
  uni.navigateTo({
    url:'/pages/vacation/record?type='+active.value
  })
}
</script>
<style lang="scss" scoped></style>
